<template>
	<view class="nav-card">
		<view class="nav-card-wrap" @click="handleClick">
			<view class="nav-pic" :style="[{'background':bagColor}]">
				<span :class="'iconfont iconSize icon-'+iconSrc" ></span>
				<i class="iconfont icon-xxx"></i>
			</view>
			<view class="nav-title">{{title}}</view>
		</view>
		<view class="notfinished-num" v-if="newtips!=0">{{newtips}}</view>
	</view>
</template>

<script>
	export default {
		name:"nav-card",
		data() {
			return {
				
			};
		},
		props:{
			iconSrc:{
				type:String,
			},
			title:{
				type:String
			},
			newtips:{
				default:0
			},
			bagColor:{
				type:String,
				default:'#FE9201'
			}
		},
		methods:{
			handleClick(){
				this.$emit('click',this.title)
			},
		}
	}
</script>

<style lang="scss" scoped>	
.nav-card{
	position: relative;
}
	.nav-card-wrap{
		display: flex;
		flex-direction: column;
		align-items: center;
		.nav-pic{
			display: flex;
			justify-content: center;
			align-items: center;
			width: 88rpx;
			height: 88rpx;
			border-radius: 10rpx;
			color: #FFFFFF;
			.iconSize{
				font-size: 48rpx;
			}
		}
		.nav-title{
			font-size: 28rpx;
			margin-top: 4rpx;
			color: #121F2C;
		}
	}
	.notfinished-num{
		position: absolute;
		top: 10rpx;
		left: 140rpx;
		width: 30rpx;
		line-height: 26rpx;
		text-align: center;
		height: 26rpx;
		font-size: 24rpx;
		padding: 5rpx 8rpx;
		color: #FFFFFF;
		background: #ea0000;
		border-radius: 15rpx;
	}
</style>
